<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

<script>
    var obj = {
        name: '张三',
        age: 25,
        score: 97,
        hobbies: ['Math', 'baskball', 'game']
    }
    var flag = {
        ...obj,
        ...{
            age: 80
        }
    }
    console.log(flag)

    var arr = [100, 200, 300]
    var a = arr ? arr.join(',') : undefined
    console.log('切割:', a)

    console.log('所有属性', Object.keys(obj))

    var k = ["123", "456"]
    console.log(k)
    k.forEach((item, index) => {
        k[index] = Number(item)
    })
    console.log(k)

    var arr = [1, [2, 3, [4, 5]]]
    console.log(arr)
</script>
</body>

</html>
